package com.zrc.ke;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.zrc.ke.core.ProxyActivity;

public class DemoActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        final LinearLayout ll = new LinearLayout(this);
        ll.setOrientation(LinearLayout.VERTICAL);

        TextView tv0 = new TextView(this);
        tv0.setText("当前是壳界面");
        tv0.setTextSize(50);

        TextView tv = new TextView(this);
        tv.setText("去app界面");
        tv.setTextSize(50);
        tv.setOnClickListener(v -> {
            Intent intent = new Intent();
            intent.setClassName(DemoActivity.this, "com.cocos.game.AppActivity");
            startActivity(intent);
            DemoActivity.this.finish();
        });

        TextView tv1 = new TextView(this);
        tv1.setText("去插件界面");
        tv1.setTextSize(50);
        tv1.setOnClickListener(v -> {
            Intent intent = new Intent(this, ProxyActivity.class);
            intent.putExtra("className", "com.zrc.plugin.PluginActivity");
            startActivity(intent);
        });

        ll.addView(tv0);
        ll.addView(tv);
        ll.addView(tv1);
        setContentView(ll);
    }
}